<?php

use think\facade\Route;
use Symfony\Component\Finder\Finder;

Route::rest([
    'index'   => ['GET', '', 'list'],
    'read' => ['GET', '/:id', 'detail'],
    'save' => ['POST', '', 'add'],
    'update' => ['PUT', '/:id', 'edit'],
    'delete' => ['DELETE', '/:id', 'delete'],
]);


Route::group('admin', function () {
    // 上传图片到本地，并且不公开
    Route::post('index/localUpload', 'admin.Index/localUpload');

    // 达人
    Route::group(function () {
        // 达人审核
        Route::get('daren/list', 'admin.daren.Daren/list');
        Route::get('daren/detail', 'admin.daren.Daren/detail');
        Route::post('daren/statusEdit', 'admin.daren.Daren/statusEdit');

    });
    // 商品任务
    Route::group(function () {
        Route::post('job/statusEdit', 'admin.job.NewJob/statusEdit');
        Route::post('job/shelfStatusEdit', 'admin.job.NewJob/shelfStatusEdit');
        Route::resource('job', 'admin.job.NewJob');
    });
    // 探店任务
    Route::group(function () {
        Route::post('probe_job/statusEdit', 'admin.job.ProbeJob/statusEdit');
        Route::post('probe_job/shelfStatusEdit', 'admin.job.ProbeJob/shelfStatusEdit');
        Route::resource('probe_job', 'admin.job.ProbeJob');
    });

    // 电商视频任务
    Route::group(function () {
        // 达人审核
        Route::get('videoJob/list', 'admin.job.CommerceVideoJob/list');
        Route::post('videoJob/statusEdit', 'admin.job.CommerceVideoJob/statusEdit');

    });

})->middleware('check_login', 'admin');
